#encoding:utf8
import logging

class ReturnHelper():
	def __init__(self):
		logging.info("Init RaiseHelper....")

	kErrorType = dict(
		client_body_decode = "Client json string decode wrong!",
		handler_dont_exit  = "Handler tag is not exist in the server!",
		params_chk         = "The params num chked wrong!"
		)

	kErrorId = dict(
		client_body_decode = 1,
		handler_dont_exit = 2,
		params_chk = 3
		)	
	
	@classmethod
	def error(cls , errorkey , exception = "Uncache exception"):
		return dict(r = self.kErrorId[errorkey] , err = self.kErrorType[errorkey])

	@classmethod
	def ret(cls , retbody):
		return dict(r = 0 , data = retbody)

	def test(cls):
		print ("test！ in test")